package com.tywh;

import com.github.pagehelper.PageHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.Properties;

/**
 * @author xhx
 * @date 2019年3月5日 上午9:30:44
 */
@ServletComponentScan("com.tywh.configuration")
@ComponentScan({"com.tywh.controller","com.tywh.service","com.tywh.configuration"})
@MapperScan("com.tywh.dao")
@EnableAutoConfiguration
public class SampleController {
	
	public static void main(String[] args) throws Exception {
		SpringApplication.run(SampleController.class, args);
	}

	//配置mybatis的分页插件pageHelper
	/*@Bean
	public PageHelper pageHelper(){
		PageHelper pageHelper = new PageHelper();
		Properties properties = new Properties();
		properties.setProperty("offsetAsPageNum","true");
		properties.setProperty("rowBoundsWithCount","true");
		properties.setProperty("reasonable","true");
		properties.setProperty("dialect","postgresql");    //配置postgresql数据库的方言支持Oracle,Mysql,MariaDB,SQLite,Hsqldb,PostgreSQL六种数据库
		pageHelper.setProperties(properties);
		return pageHelper;
	}*/

}
